<?

//Connect to db:
function dbConn()
{
$username = "root";
$password = "";
$hostname = "localhost";	
$handler = mysql_connect($hostname, $username, $password) 
	or die("Unable to connect to MySQL");
//print "Connected to MySQL<br>";

if (!mysql_select_db('ec_methodology', $handler)) {
    echo 'Could not select database';
    exit;
}
return $handler;
}

//DB Close:
function dbClose($handler)
{
	mysql_close($handler)
	or die("Error closing connection. Was the connection open before?");
	//echo "conexiune inchisa cu succes";
}

//query:
function returnQuery($qr,$handler)
{
//SELECT * FROM `projects` WHERE `ID` LIKE '1'
$result = mysql_query($qr);
if (!$result) {
    $message  = 'Invalid query: ' . mysql_error() . "\n";
    $message .= 'Whole query: ' . $query. "\n";
    die($message);
	//de adaugat in continuare cum se afiseaza tabelul!!!
}
return $result;
}

?>
